package com.cit.draw.redis;


import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;

/**
 * @author gutzeit
 * @since 5/3/12 5:51 PM
 */
public interface CachingProvider {
	@Nullable
	public <T> T getEntity(@Nonnull Class<T> entityType,
			@Nonnull String entityIdentifier);
	@Nullable
	public <T> Collection<T> getQueryResult(@Nonnull Class<T> entityType,
			Object... parameters);

	public <T> void putEntity(@Nonnull T entity,
			@Nonnull String entityIdentifier);

	public <T> void putQueryResult(@Nonnull Collection<T> results,
			@Nonnull Class<T> entityType, Object... parameters);

	public <T> void deleteEntityCache(@Nonnull Class<T> entityType,
			@Nonnull String entityIdentifier);
	public <T> void invalidateEntityQueryCache(@Nonnull Class<T> entityType);
}
